package com.cls.business.service;

import com.cls.business.entity.DeclareTopic;
import com.cls.business.entity.Topic;

import com.cls.business.entity.TopicPlan;
import com.cls.business.entity.TopicSubjectDetail;
import com.cls.common.entity.QueryRequest;
import com.github.pagehelper.PageInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 课题 Service接口
 *
 * @author weimaomao
 * @date 2020-11-10 09:57:54
 */
public interface ITopicService extends IService<Topic> {
    /**
     * 查询（分页）
     *
     * @param request QueryRequest
     * @param topic topic
     * @return PageInfo<Topic>
     */
    PageInfo<Topic> findTopics(QueryRequest request, Topic topic);

    /**
     * 查询（所有）
     *
     * @param topic topic
     * @return List<Topic>
     */
    List<Topic> getPublishedTopics(Topic topic);


    /**
     * 根据planid查询课题
     * @param planId
     * @return
     */
    List<Topic> findTopicsByPlanId(Long planId);




    /**
     * 新增
     *
     * @param topic topic
     */
    void createTopic(Topic topic);

    /**
     * 修改
     *
     * @param topic topic
     */
    void updateTopic(Topic topic);

    /**
     * 删除
     *
     * @param topic topic
     */
    void deleteTopic(Topic topic);

    /**
     * 删除
     *
     * @param ids topic
     */
    void deleteTopics(String[] ids);

    /**
     * 创建topicCode
     * @param year
     */
    void createTopicCode(Long planId,String year);

    /**
     * 下载
     * @param planId
     * @param response
     */
    void download(Long planId, HttpServletResponse response);



    boolean autoWriteSubjectType(List<Topic> topics, List<DeclareTopic> declareTopics, List<TopicSubjectDetail> details);

    PageInfo<Topic> findReviewTopics(QueryRequest request, Topic topic);

    List<Topic> findReviewTopics(Topic topic);

    boolean classifyTopic(Long planId, Long topicId, List<TopicSubjectDetail> details);


    boolean classifyEntrustTopic(Long planId, Long topicId, List<TopicSubjectDetail> details);
}
